<template>
  <div>
    主页
    <Test v-model="inpVal"></Test>
    <span>{{inpVal}}</span>
    <button @click="sub">按钮</button>
    <Comp></Comp>
    <comp :foo.sync="bar"></comp>
    它实际上就是
    <comp :foo="bar" @update:foo="val => bar = val"></comp>

  </div>
</template>
<script>
import Test from '@/components/test/Test'
import Comp from '@/components/test/Comp'
export default {
  components: { Test, Comp },
  data: () => ({
    inpVal: '123'
  }),
  methods: {
    sub(){
      this.inpVal = '哈哈'
    }
  }
}
</script>